package helloWorld.musicplayer;

import java.util.Vector;

public class Mp3Player {

	private Vector<String> playList;
	private UrlPlayer mediaPlayer;

	public Mp3Player() {
		playList = new Vector<String>();
		mediaPlayer = new UrlPlayer();
	}

	public void setPlayList(Vector<String> songList) {
		this.playList = songList;
	}

	public void playSong(int id) {
		if (playList.size() > id) {
			mediaPlayer.play(playList.elementAt(id));
		}
	}

	public void stop() {
		mediaPlayer.stop();
	}

	public void clearPlayList() {
		playList.clear();
	}
}
